Dynamic validation framework extension

ABSTRACT

A programming language framework may be enhanced to provide for dynamic validation. Dynamic validation allows the validator function for any variable to be selected at runtime rather than statically declared at programming-time. Instead of annotating a variable with an annotation that refers to a specific validator function or constraint type, programmers can annotate a variable with an annotation that indicates that the validator function will be selected dynamically at runtime. When a runtime instance of the variable is created, the programming language framework may identify the dynamic validation annotation on the variable, and then use the runtime values in the variable to determine which validator function(s) should be used.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/809,025, filed Mar. 4, 2020, entitled “DYNAMIC VALIDATION FRAMEWORKEXTENSION,” which is hereby incorporated by reference in its entirety.

BACKGROUND

Programming languages have recently provided advanced mechanisms forenforcing constraints on member variables, classes, and functions.Constraints may be used to validate different data fields to ensure thatthey meet some one or more predefined requirements. Traditionally,constraints have been enforced using customized error-checking code thatwas included throughout the software. However, modern programminglanguages have begun providing mechanisms for validating data againstsets of constraints as part of the programming language framework.Instead of rewriting the constraints and validation code for eachproject and each data set, programmers can instead use theconstraint-enforcement mechanisms of the programming language frameworkto improve the efficiency of software development and the consistencywith which common datatypes may be validated.

For example, the JAVA programming language provides validation forconstraints imposed on class modules or “beans.” Bean validation isdefined in the JSR 380 specification, which allows for static validationon JAVA beans. In static validation, an attribute (e.g., a membervariable) inside the bean meets some predefined criteria, such as beingnon-null, non-empty, within a specified numeric range, and so forth. Ifthese predefined criteria are not met, the framework reports aconstraint violation. The validation framework also allows users tocreate user-defined constraints and user-defined validators. These allowusers to customize various validation routines to match a desired dataformat.

BRIEF SUMMARY

Modern programming language frameworks provide constructs that performstatic validation on runtime values using predefined constraints. Whenruntime instances are created, the runtime values stored in variablesand/or member attributes may be provided to a validator function thatensures that the value conforms to the predefined constraint. Predefinedconstraints may include numerical ranges, acceptable string patterns,date ranges, specific formatting, and/or other requirements that may beenforced on a data value. To activate a constraint, the variable ormember attribute may be annotated with a text string that refers to aspecific validator function. Thus, the validator function to be used fora specific variable is set at programming-time, not at runtime.

The embodiments described herein enhance programming language frameworksto provide for dynamic validation. Dynamic validation allows thevalidator function for any variable to be selected at runtime ratherthan statically declared at programming-time. Instead of annotating avariable with an annotation that refers to a specific validator functionor constraint type, programmers can annotate a variable with anannotation that indicates that the validator function will be selecteddynamically at runtime. When a runtime instance of the variable iscreated, the programming language framework may identify the dynamicvalidation annotation on the variable, and then use the runtime valuesin the variable to determine which validator function(s) should be used.

The programming language framework may be modified to include additionalannotation definitions. One annotation definition may be used toannotate variables that should be subject to dynamic validation asdescribed above. Another annotation definition may be used to annotatethe user-defined dynamic value validator functions themselves. Thesecond annotation may receive names and/or values for attributes to bedynamically validated. For example, a class definition may include twomember attributes that operate as a key-value pair (e.g., string key,string value). The second annotation may reference the “key” attributeand determine whether the value in the “key” attribute indicates thatthis key-value pair stores a phone number (e.g., key=“phone”;value=“571-555-1534”). The annotation used on the validator function canspecify that it should be used when an attribute named “key” has a valueof “phone,” and the code inside the validator function can then validatethe “value” attribute to determine whether it stores a properlyformatted phone number. If the “key” value stores something different,such as “date” or “time,” then this this validator would not be executedon this class instance. This decision is made at runtime by theframework.

When the programming language framework receives a variable at runtimeannotated for dynamic validation, the framework may first execute anytraditional static validations. If a static validation fails, then nodynamic validation may be necessary. After static validations arecomplete, the programming language framework may generate a list of alldynamic validator functions available in a class path or programdirectory. The list of available dynamic validators may include anycustom dynamic value validator functions that have been defined byprogrammers. The framework may then cycle through the list of availabledynamic value validator functions and identify any for which the runtimevalues of the annotated variable satisfy the annotated constraints onthe dynamic value validator function. Continuing with the example above,the framework may identify the phone number value validator function inthe class path and compare the attributeName=“key” andattributeValue=“phone” constraint in the function annotation to theruntime values of the variable. Any identified validator functions maythen be executed on the runtime values. In some embodiments, theframework may provide an abstract base class that includes protectedhelper functions for executing dynamic validations, and this abstractbase class may be overridden in the custom dynamic value validatorswritten by the programmer.

These programming language framework enhancements allow a programmer toencapsulate different dependencies between member attributes indifferent validator functions that are selected dynamically at runtime.When only static validation is used, a validator function was requiredto include branches of if/then statements that compare differentpossible values. These statements are difficult to maintain over time ascode evolves. However, when using dynamic validation, each variabledependency for validation can be handled separately and independently,and new dependencies can be easily added without limitation byannotating a new validator function with the added dependency.

BRIEF DESCRIPTION OF THE DRAWINGS

A further understanding of the nature and advantages of variousembodiments may be realized by reference to the remaining portions ofthe specification and the drawings, wherein like reference numerals areused throughout the several drawings to refer to similar components. Insome instances, a sub-label is associated with a reference numeral todenote one of multiple similar components. When reference is made to areference numeral without specification to an existing sub-label, it isintended to refer to all such multiple similar components.

FIG. 1 illustrates a diagram of a constraint validation framework for aprogramming language, according to some embodiments.

FIG. 2A illustrates an example of a bean that uses a built-in constraintannotation, according to some embodiments.

FIG. 2B illustrates definitions for a custom validator/constraint.

FIG. 3 illustrates a program that validates the constraints in the bean,according to some embodiments.

FIG. 4 illustrates a diagram of a framework extension for dynamicvalidation, according to some embodiments.

FIG. 5 illustrates a dynamic validation constraint annotation, accordingto some embodiments.

FIG. 6 illustrates an example of a bean that uses dynamic validation,according to some embodiments.

FIG. 7 illustrates a new annotation added to the framework that definesrelationships between dynamic values, according to some embodiments.

FIG. 8 illustrates an example of an abstract class for aDynamicValueValidator, according to some embodiments.

FIG. 9A illustrates a definition for a DynamicValidator class, accordingto some embodiments.

FIG. 9B illustrates an isValid( ) function for the DynamicValidator,according to some embodiments.

FIG. 9C illustrates methods for the DynamicValidator to perform staticvalidation and matching between metadata defined in the DynamicValueannotation and the corresponding bean, according to some embodiments.

FIG. 10A illustrates an example of a user-defined custom dynamic valuevalidator for dynamic validation, according to some embodiments.

FIG. 10B illustrates an example of a custom dynamic value validator withmultiple constraint annotations, according to some embodiments.

FIG. 11 illustrates an example of a program where dynamic validation maybe invoked, according to some embodiments.

FIG. 12 illustrates a flowchart of a method for dynamically validatingvariable dependencies at runtime, according to some embodiments.

FIG. 13 illustrates a simplified block diagram of a distributed systemfor implementing some of the embodiments.

FIG. 14 illustrates a simplified block diagram of components of a systemenvironment by which services provided by the components of anembodiment system may be offered as cloud services.

FIG. 15 illustrates an exemplary computer system, in which variousembodiments may be implemented.

DETAILED DESCRIPTION

In the JAVA programming language, various standards (JSR 380, JSR 349,JSR 303, etc.) describe a framework that may be used for the validationof attributes within JAVA beans. Bean validation is commonly used whendata flows from a presentation layer to a persistence layer. Before thisframework, users typically had to duplicate their validation code ineach layer of their application. The validation framework allows usersto perform a validation using a single mechanism via metadata that isadded to domains or classes. The metadata may include constraints thatare added via XML, descriptors. For example, the default metadata sourcefor a JAVA class may include a JAVA annotation that is added to atarget. The target data may then be validated against the constraintreferenced by the annotation at runtime.

A constraint generally is comprised of two separate parts. A first partof the constraint includes a constraint annotation, which includes anannotation that may be added to the code to identify a runtimeconstraint. Generic constraint annotations may target a field, a method,a constructor, a parameter, a type, and so forth. A second part of theconstraint may include a collection of validators that implement theconstraint. For example, a constraint may include an allowable numericrange for a member variable, and a validator may include an isValid( )function comprising code that determines whether the runtime value ofthe member variable falls within the allowable numeric range. Thus, aconstraint annotation and a validator for that constraint annotationwork together to perform runtime validation of constraints on programdata.

FIG. 1 illustrates a diagram 100 of a constraint validation framework102 for a programming language, according to some embodiments. Incomputer programming, a software framework is an abstraction in whichsoftware providing generic functionality can be augmented by user code.The framework 102 generally provides a standardized library and methodsto build and deploy applications, and it may provide functionality thatis part of a larger software platform to facilitate the development ofsoftware applications. For example, the framework 102 may includesupport programs, compilers, code libraries, toolsets, applicationprogramming interfaces (APIs), and other components or developmentenvironments. For example, the JAVA programming language may be combinedwith various frameworks that provide utilities, programming languagefeatures, and code libraries that can be used to implement constraintvalidation. As used herein, the framework 102 itself may bedistinguished from user code or custom, user-defined validators andconstraint annotations.

A user program 106 may include user code that is compiled, assembled,interpreted, and/or executed as a software application. For example, theprogram 106 may include a main( ) function that instantiates classobjects, executes functions, stores variables, and/or otherwiseimplements various aspects of a software application. The program 106may be considered user code, and may be distinguished from the framework102. Additionally, the user code may include one or more customclass/object definitions. In the JAVA programming language, theseclasses may be organized in packages referred to as “beans.” The program106 may instantiate runtime objects using the class definitions in abean 108.

As is common in many class definitions, classes within the bean 108 mayinclude member variables, member functions, and other data. A constraintannotation 110 may be added in various locations to the classdefinitions in the bean 108. The scope of the annotation 110 may varybased on the location of the annotation 110 and/or the definition of thecorresponding constraint annotation definition. As will be described inthe examples below, the annotation 110 typically includes a line of codethat identifies the constraint and may provide values for theconstraint, such as messages and/or other information that may be usedwhen validating the constraint.

In order to validate the constraint, a validator may be executed by theprogram 106. In some cases, the framework 102 may include one or morebuilt-in validators 104. The built-in validators may include code thatvalidates a set of built-in constraint definitions. For example, someJAVA frameworks may include built-in support for simple constraints. Thejavax.validation.constraints package includes built-in constraints, suchas constraints that enforce minimum/maximum values, enforcenull/non-null values, enforce predefined regular expression patterns,enforce predetermined sizes, and so forth. The bean 108 may utilizethese built-in validators/constraints 104 by simply adding thecorresponding annotation 110 to the code of the bean 108.

In addition to using the built-in validators/constraints 104, theprogram 106 may also use custom a validator/constraint 112. To use acustom validator and/or a custom constraint, a user-defined validatordefinition and/or constraint definition may be provided to the program106. The custom validator/constraint 112 may each implement predefinedinterfaces and/or abstract classes provided by the framework 102 suchthat the custom validator/constraint 112 can be executed by theframework 102 the same way that the built-in validators/constraints 104are used at runtime.

FIG. 2A illustrates an example of a bean 108 that uses a built-inconstraint annotation 110, according to some embodiments. This beanincludes a definition of a public class that encapsulates a key-valuedata structure. Many modern data structures use this paradigm forstoring many different datatypes in a unified format. A generic formatmay use a key-value structure where data is stored as a key-value pair.The key portion of the pair may be used to describe a data type (or anyother type of metadata) for the value portion of the pair. For example,the key portion of the pair may define a data type, such as a phonenumber, an address, a username, etc. While the corresponding valueportion of the pair may include a specific phone number, a specificaddress, a specific user's name, etc. This flexible system allows anytype of data to be stored, so long as the key defines the data type andthe value defines the data value. This KeyValue class may be used hereinas an example of a bean that may use dynamic validation as describedbelow. However, this class is used only by way of example it is notmeant to be limiting. Dynamic validation may be used with any datastructure, including classes and other encapsulations of data.

The bean 108 may include private member variables for both the key andthe value. The example of FIG. 2A includes a constraint annotation 110that may be used for validating the value of the string. Some of thebuilt-in constraints in some JAVA frameworks may include the @NotBlankconstraint, which indicates that the string value in the key variableshould not be blank. The annotation 110 includes a parameter that setsthe message accompanying a constraint violation to a specified value,such as “key is blank.” Instead of writing custom validation code, theuser can simply include the constraint annotation 110 to enforcepredefined constraints that can be automatically validated by functionsin the framework without writing additional code.

In addition to using built-in constraints, programming languageframeworks may also allow users to define their own custom constraintannotations and custom validators for validating those constraints. FIG.2B illustrates definitions for a custom validator/constraint 112. First,an example of a constraint definition 220 is provided that allows usersto define their own constraint annotations. The constraint definition220 may specify a target upon which the constraint may be applied (e.g.,a field, a method, a type, etc.). The constraint definition 220 may alsoinclude message, group, and/or payload fields. Other fields may be addedto provide information or other settings that may enhance validation.For example, the message field may be used to create an error message,which may be overwritten by a parameter as illustrated in FIG. 2A. Groupfields may define groups to which the constraint belongs. The payloadfield may specify other data with which the constraint may beassociated. For example, the payload may be used to associate a severitywith the constraint.

Along with the constraint definition 220, a validator definition 222 isalso provided to specifically validate the constraint of the constraintannotation definition 220. The validator definition 222 in the contextof the JAVA programming language may implement the ConstraintValidatorinterface, and may override two public functions. The initialize( )function may be used to receive data from the constraint annotation andinitialize the validator. The isValid( ) function holds the code that isused to validate the corresponding constraint against the correspondingobject. If an annotation for the constraint definition 220 is used on atarget object that corresponds to the object type in the validatordefinition 222, then the constraint may be validated. In some cases, thevalidator definition 222 may be defined generically such that the targetclass is of the Object type. In this case, the framework invokes theuser-defined validation code for all targets annotated with theconstraint. For example, the validator definition 222 may validate alltargets bean annotated with the @MyConstraint constraint having a typeof MyObject. Note that the validator definition 222 cannot be selectedbased on runtime values of attributes with in the object.

FIG. 3 illustrates a program 106 that validates the constraints in thebean 108, according to some embodiments. First, the program 106instantiates a validator 302 of a default type. The program 106 thendefines a validate( ) function 308 that performs a validation on aspecified list of objects in a parameter list. The main( ) function ofthe program 106 then instantiates a new KeyValue object with specifiedstrings for the key and the value attributes. This instantiated objectis then passed as a parameter 306 to the validate function. The validatefunction 308 then executes the specified validator on the object andreports any constraint violations.

Although users may define custom validators and constraints in existingprogramming language frameworks, the embodiments described hereinimprove on existing programming language frameworks to providemechanisms for validating dependencies between attributes through theframework based on runtime values. These improvements allow customvalidators and constraints to be readily implemented to provide deepvalidation where a value for one attribute can influence the type ofconstraint that is validated on another attribute. For example, if thevalue for the key in a KeyValue object includes the string value of“phone,” then the user may wish to validate the string in the valueattribute to ensure that it is a properly formatted phone number. Inanother example, if the key is “date,” then the user may wish tovalidate the value to ensure that the string is a properly formatteddate. This cannot be performed with a static validation because only asingle value of the target is validated. And while the user can validaterelationships by defining their own constraints and providing validationcode, the user would need to define a new combination of constraint andvalidator for each relationship in the target. This code is very hard tomaintain and very hard to parse. The embodiments described hereininstead describe an extension to a validation framework that solves thisproblem in a generic way rather than requiring specific code for eachrelationship.

FIG. 4 illustrates a diagram 400 of a framework extension for dynamicvalidation, according to some embodiments. This diagram 400 is similarto the diagram 100 of FIG. 1 , except that the framework 102 has beenextended to include a number of additional modules: a dynamic validation402 annotation, a dynamic validator 404, a dynamic value annotation 406,and a dynamic value validator 408. Each of these modules will bedescribed in greater detail below. In short, these modules allow theframework to handle a @DynamicValidation annotation to then dynamicallyvalidate different relationships between different data fields based onruntime values, such as relationships between keys and values in theKeyValue class described above. It should be noted that these modulesare part of the programming language framework and are not user-definedclasses that the user is required to write. These are modules that maybe deployed with the framework 102, and may thus be distinguished fromcode that a user may write to interact with the framework 102.

In this example, a bean 416 may include a dynamic annotation 410, suchas the @DynamicValidation annotation described in detail below. When aprogram 414 creates an instance of an object defined in the bean 416,the dynamic annotation 410 will instruct the framework 102 to perform adynamic validation using a custom dynamic value validator 412 defined bythe user. As described below, the custom dynamic value validator 412 mayextend abstract base classes made available in the extension to theframework 102, thus minimizing the code that a user may be required towrite.

FIG. 5 illustrates a dynamic validation constraint annotation, accordingto some embodiments. The starting point for dynamic validation is thedefinition of the constraint annotation and its corresponding validator.The dynamic validation constraint definition 402 defines the annotationthat may be added to a class to indicate to the framework that dynamicvalidation should be executed rather than a traditional validation.Since the dynamic validation may be used to evaluate relationshipsbetween different member variables of a class, the constraint definition402 sets the target value to be TYPE, which allows access to all of theattributes within the object definition. The name given for thisconstraint definition 402 is DynamicValidation (which corresponds to the@DynamicValidation annotation). However, this name is used only by wayof example and is not meant to be limiting. Any other name may be usedfor the dynamic validation constraint definition 402. In someembodiments, no default message 502 needs to be defined with theannotation. As described below, any message defined within thisannotation may be omitted and replaced during validation by thevalidator. Also note that the definition 502 specifies that thisconstraint may be validated by the DynamicValidator class, the name ofwhich is also used only by way of example, and the function of which isdescribed in detail below.

FIG. 6 illustrates an example of a bean 416 that uses dynamicvalidation, according to some embodiments. Using the definitiondescribed above in FIG. 5 , the KeyValue class may be annotated with the@DynamicValidation constraint annotation. This allows the framework toinvoke a validator that dynamically evaluates the relationship betweenthe runtime values of the key and value member attributes. Note thatbecause the target value for the dynamic validation constraintdefinition 402 is TYPE, the dynamic annotation 410 may be applied at theclass level rather than at the individual member variable levels. Thisdynamic annotation 410 based on the dynamic validation constraintdefinition 402 may be added at a similar location of any bean wheredynamic validation should be invoked.

FIG. 7 illustrates a new annotation added to the framework that definesrelationships between dynamic values, according to some embodiments. Asdescribed in detail below, this annotation may be used for customdynamic value validators to indicate runtime attribute values that maycause the validator to be invoked. Specifically, FIG. 7 illustrates adynamic value annotation definition 406 that defines relationshipsbetween values. This particular annotation includes two methods:attributeName and valuePattern. The attributeName method returns a nameof an attribute for which the value will be checked in the target bean.The valuePattern method returns a regular expression for checking thevalue. This annotation may be used on instances of theDynamicValueValidator described in detail below. This extension ensuresthat only beans satisfying the relationship definition defined in the@DynamicValue need to be further validated. Additionally, thisannotation may be used on the target DynamicValueValidator instancesmultiple times to allow the user to define multiple relationships. Forexample, if there are more @DynamicValue annotations for theDynamicValueValidator, each of these relationships defined by theannotations can be further validated.

FIG. 8 illustrates an example of an abstract class for aDynamicValueValidator, according to some embodiments. First, note thatthe DynamicValueValidator class is an abstract class, which means thatany custom dynamic value validator classes defined by the user shouldextend the DynamicValueValidator 408, and the extension should beannotated with at least one @DynamicValue as described above. Thisabstract class may be patterned after thejavax.validation.ConstraintValidator abstract class in some JAVAframeworks that is extended by regular user-defined validators.

Each validator that extends the DynamicValueValidator class shouldprovide an implementation of the isValid( ) method 802. This method maybe called by the extended class if the relationship defined in the@DynamicValue is met for the validated bean. Specifically, the code forproviding the actual validation may be provided in the custom dynamicvalue validator in an isValid( ) function that overrides this abstractfunction in the abstract base class.

Additionally, the DynamicValueValidator 408 includes two protectedmethods: validateCustomConstraints( ) 804 and useConstraint( ) 806,which may be used to facilitate user-defined validators. ThevalidateCustomConstraints( ) method 804 may be used in a user-createdvalidator if it defines its own object to be statically validated. Oneof the core concepts behind validation is that the validator defines itsown inner class having attributes annotated with constraints. Then,these attributes are populated with data from the bean being validated.The instance of the class is then passed to thevalidateCustomConstraints( ) method 804. If this method 804 identifiesany constraint violation in the validated object, it takes the firstmessage from the violation, passes it to theConstraintValidationContext, and returns false. The helper method,useConstraint( ) 806, may be used to provide a user-defined message ifthe user specifies a deep validation of the bean that fails (e.g., theuser validates whether a connection to a provided URL can be opened).Both of these functions may be called by the custom dynamic valuevalidator written by the user that extends this class. As part of theframework extension, these functions reduce the amount of code requiredto write custom dynamic value validators.

FIG. 9A illustrates a definition for a DynamicValidator 404 class,according to some embodiments. The DynamicValidator implements theConstraintValidator template that is already defined in the framework.Importantly, the DynamicValidator 404 serves as an entry point to theframework extension added by the embodiments described herein forperforming dynamic validation. This class first creates a validator forchecking statically defined constraints, creates a list of dynamicvalidators that are loaded from a class path scan, and creates a staticinstance of a VALIDATOR. It should be noted that the DynamicValidatormay be used for beans of any type. When the instance of theConstraintValidator is created, it loads all classes extending theDynamicValueValidator described above. A constructor 902 creates aninstance of a DynamicValidator according to the code in FIG. 9A.Specifically, if any of the dynamic validators in the class path are notyet instantiated, they are synchronously loaded and instantiated. Asshown in FIG. 9A, the code filters out any abstract classes, any classeswithout no-argument constructors, and classes that do not have at leastone correct @DynamicValidation annotation. Next, each of these classesare instantiated and cached. Some embodiments may use a full class pathscan, while other embodiments may use Contexts and Dependency Injection(CDI) to obtain all instances of the DynamicValueValidator having the@DynamicValidation annotation. If CDI is used, then user-defined dynamicbean validators should define their scope to be visible for the CDIlookup. This approach may be preferable in JAVA EE environments.

FIG. 9B illustrates an isValid( ) 910 function for the DynamicValidator,according to some embodiments. As soon as the isValid( ) method 910 isinvoked in the DynamicValidator 404, it may perform a validation of anystatically defined constraints within the bean (912). If any staticconstraint is violated, no dynamic validation may be necessary, and thusthe isValid( ) method may return and exit. Statically definedconstraints may have a higher priority than dynamically definedconstraints in some embodiments. Alternatively, if there are noconstraint violations on statically defined constraints, then dynamicvalidation may begin. The list of dynamic validators populated above inthe constructor 902 may be filtered to find validators that are definedfor this particular type of bean, and for which the relationship definedin the @DynamicValue is satisfied (914). Note that if the attribute doesnot have the type String, the toString( ) method may be called toretrieve a string representation of the attribute. Finally, anyvalidator satisfying these conditions may then be passed to theirrespective isValid( ) methods (916).

FIG. 9C illustrates methods for the DynamicValidator to perform staticvalidation and matching between metadata defined in the DynamicValueannotation and the corresponding bean, according to some embodiments.The isStaticValid( ) function 920 may perform validation on allproperties found in the current class, as well as recursively in anyparent classes. This private function 920 is called above in FIG. 9B tofirst determine whether any static validations fail before performingany dynamic validations. The matchDynamicAnnotation( ) function 922 mayperform matching between metadata defined in the DynamicValue annotationand the bean. This private member function may return true if datadefined in the annotation matches data found in the bean. This function922 is called above in FIG. 9B when filtering dynamic validators that donot have the specified relationship condition.

FIGS. 7-9C illustrate implementations of various modules that may beincluded in a framework extension for performing dynamic validation,according to some embodiments. These example modules may use the JAVAprogramming language and specific JAVA constructs as an example toprovide an enabling disclosure. However, these examples are not meant tobe limiting. The principles for extending a framework to provide dynamicvalidation may be applied to any programming language, and may havedifferent implementations other than those specifically used by way ofexample in these figures.

FIG. 10A illustrates an example of a user-defined custom dynamic valuevalidator 412 for dynamic validation, according to some embodiments. Thecustom dynamic value validator 412 may be the only code that needs to bewritten by a user to employ dynamic validation. First, the validator 412should include instances of one or more @DynamicValue annotations 1002.The validator 412 should also extend 1004 the DynamicValueValidatorabstract class described above in FIG. 8 . This extended class providesan implementation for the abstract isValid( ) function 1006 from theparent class. Some embodiments may also provide private helper functionsto perform the validation.

The dynamic @DynamicValue annotation 1002 specifies the variable andvalue for that variable that will trigger this dynamic validation. Inthis example, dynamic validation will be triggered when the targetobject includes a variable with the attribute name “key,” and where thevalue of that attribute includes a string with the “phone number” textdepicted in the annotation 1002. The validator 412 extends 1004 theDynamicValueValidator abstract parent class specifically for objects ofthe type KeyValue described above in FIG. 2A and FIG. 6 . The isValid( )receives a target KeyValue object, then uses the private PhoneNumberclass to validate the phone number. At this point, the value variable inthe KeyValue target object is expected to have a valid phone number tobe validated because the key variable dynamically indicated such. Notethat if the value of the attribute in the KeyValue object did not matchthe value in the annotation of the custom dynamic value validator 412,then the validator would not be executed on the instance of the object.

FIG. 10B illustrates an example of a custom dynamic value validator withmultiple constraint annotations, according to some embodiments. Althoughthe example in FIG. 10A only uses a single @DynamicValue annotation,other implementations may use a plurality of @DynamicValue annotations.For example, the KeyValue class described above includes a single key ina single value. Other embodiments include a TwoKeyValue class thatincludes two keys and a single value. The first key (key1) may still beused to specify that the value is a phone number, while the second key(key2) may be used to specify a country code. Because each country mayhave different formats for their phone numbers, both keys may beincluded individually in the @DynamicValue annotations 1010 in order forthis particular custom dynamic value validator 412 to be invoked. Thisvalidator 412 may operate the same as the validator in FIG. 10A, exceptthe class may be extended 1012 using the TwoKeyValue class rather thanthe KeyValue class. Similarly, the isValid( ) function 1014 may receivea TwoKeyValue object rather than a KeyValue object.

FIG. 11 illustrates an example of a program 414 where dynamic validationmay be invoked, according to some embodiments. As described above inrelation to FIG. 6 , the KeyValue class has been annotated with the@DynamicValidation constraint. When a new instance 1104 of the KeyValueclass is created, string values may be provided for the key and valueattributes. In this example, the key is set to be “phone”, which willqualify for the custom dynamic value validator 412 in FIG. 10 . Thevalidate( ) function may then be called to dynamically check the valueof the key (“phone”) and invoke the custom dynamic value validator 412to ensure that the phone number provided in the value attribute is ofthe proper format.

FIG. 12 illustrates a flowchart 1200 of a method for dynamicallyvalidating variable dependencies at runtime, according to someembodiments. The method may include receiving, at a programming languageframework, an instance of an object (1202). The instance of the objectmay be instantiated from an object definition. For example, a classobject may be instantiated based on a class definition file. The classdefinition may be part of a bean or other software module. Thedefinition of the object, such as the class definition, may be annotatedwith a constraint. The constraint may indicate that instances of theobject should be subject to dynamic validation rather than staticvalidation or other forms of custom, user-defined validation routines.Dynamic validation may imply that a type of validation routine andconstraints that are applied to the instance of the object depend onvariable runtime values in the object instance. For example, the@DynamicValidation constraint annotation may be used on a classdefinition as illustrated in FIG. 6 . An instance of the object (e.g.,the KeyValue object) may be instantiated and passed to the framework aspart of a validate function as illustrated in FIG. 3 .

The method may also include receiving one or more validators that areannotated with an annotation that identifies an attribute in thedefinition of the object, and a value for the attribute (1204). Forexample, the custom dynamic value validators in FIG. 10A and FIG. 10Bmay be annotated using the @DynamicValue annotation from FIG. 7 . Theannotation may include an attribute name that identifies the attributein the definition of the object, along with a corresponding value forthe attribute. For example, the attribute may be identified by anattribute name, such as “key,” and the value may include a value string,such as “phone number” as used in the examples above. The validator maybe received by the framework as it extends an abstract base class. Thevalidator may also implement a Boolean function that returns anindication of whether the value passed the constraint (e.g., an isValid() function). The validator may include user-defined code that implementsa constraint, such as a format, minimum, maximum, range, and/or anyother variable constraint.

The method may additionally include identifying a validator in the oneor more validators for which a value of the attribute in the instance ofthe object matches the value of the attribute in the annotation of thevalidator (1206). For example, the DynamicValidator class in FIG. 9A mayidentify all of the validators in a runtime path or otherwise associatedwith a program. The constructor for the DynamicValidator may then cyclethrough each of the available validators and identify validators forwhich the annotation (e.g., the DynamicValue parameters) match the valuefor the corresponding attribute in the object instance. In someembodiments, each validator may have more than one (i.e., a pluralityof) DynamicValue annotations, each of which may be satisfied to executethe validator on the object instance.

The method may further include executing the validator using theinstance of the object (1208). The identified validator, along with anyother validators that match the annotation criteria, may be executed onthe instance of the object. For example, an attribute value may bevalidated against a constraint, and the constraint may be selected basedon the value of another attribute, thus allowing attribute dependenciesto influence which validators are executed and the results of thosevalidators.

It should be appreciated that the specific steps illustrated in FIG. 12provide particular methods of performing a dynamic validation accordingto various embodiments. Other sequences of steps may also be performedaccording to alternative embodiments. For example, alternativeembodiments may perform the steps outlined above in a different order.Moreover, the individual steps illustrated in FIG. 12 may includemultiple sub-steps that may be performed in various sequences asappropriate to the individual step. Furthermore, additional steps may beadded or removed depending on the particular applications.

Each of the methods described herein may be implemented by a computersystem. Each step of these methods may be executed automatically by thecomputer system, and/or may be provided with inputs/outputs involving auser. For example, a user may provide inputs for each step in a method,and each of these inputs may be in response to a specific outputrequesting such an input, wherein the output is generated by thecomputer system. Each input may be received in response to acorresponding requesting output. Furthermore, inputs may be receivedfrom a user, from another computer system as a data stream, retrievedfrom a memory location, retrieved over a network, requested from a webservice, and/or the like. Likewise, outputs may be provided to a user,to another computer system as a data stream, saved in a memory location,sent over a network, provided to a web service, and/or the like. Inshort, each step of the methods described herein may be performed by acomputer system, and may involve any number of inputs, outputs, and/orrequests to and from the computer system which may or may not involve auser. Those steps not involving a user may be said to be performedautomatically by the computer system without human intervention.Therefore, it will be understood in light of this disclosure, that eachstep of each method described herein may be altered to include an inputand output to and from a user, or may be done automatically by acomputer system without human intervention where any determinations aremade by a processor. Furthermore, some embodiments of each of themethods described herein may be implemented as a set of instructionsstored on a tangible, non-transitory storage medium to form a tangiblesoftware product.

FIG. 13 depicts a simplified diagram of a distributed system 1300 forimplementing one of the embodiments. In the illustrated embodiment,distributed system 1300 includes one or more client computing devices1302, 1304, 1306, and 1308, which are configured to execute and operatea client application such as a web browser, proprietary client (e.g.,Oracle Forms), or the like over one or more network(s) 1310. Server 1312may be communicatively coupled with remote client computing devices1302, 1304, 1306, and 1308 via network 1310.

In various embodiments, server 1312 may be adapted to run one or moreservices or software applications provided by one or more of thecomponents of the system. In some embodiments, these services may beoffered as web-based or cloud services or under a Software as a Service(SaaS) model to the users of client computing devices 1302, 1304, 1306,and/or 1308. Users operating client computing devices 1302, 1304, 1306,and/or 1308 may in turn utilize one or more client applications tointeract with server 1312 to utilize the services provided by thesecomponents.

In the configuration depicted in the figure, the software components1318, 1320 and 1322 of system 1300 are shown as being implemented onserver 1312. In other embodiments, one or more of the components ofsystem 1300 and/or the services provided by these components may also beimplemented by one or more of the client computing devices 1302, 1304,1306, and/or 1308. Users operating the client computing devices may thenutilize one or more client applications to use the services provided bythese components. These components may be implemented in hardware,firmware, software, or combinations thereof. It should be appreciatedthat various different system configurations are possible, which may bedifferent from distributed system 1300. The embodiment shown in thefigure is thus one example of a distributed system for implementing anembodiment system and is not intended to be limiting.

Client computing devices 1302, 1304, 1306, and/or 1308 may be portablehandheld devices (e.g., an iPhone®, cellular telephone, an iPad®,computing tablet, a personal digital assistant (PDA)) or wearabledevices (e.g., a Google Glass® head mounted display), running softwaresuch as Microsoft Windows Mobile®, and/or a variety of mobile operatingsystems such as iOS, Windows Phone, Android, BlackBerry 10, Palm OS, andthe like, and being Internet, e-mail, short message service (SMS),Blackberry®, or other communication protocol enabled. The clientcomputing devices can be general purpose personal computers including,by way of example, personal computers and/or laptop computers runningvarious versions of Microsoft Windows®, Apple Macintosh®, and/or Linuxoperating systems. The client computing devices can be workstationcomputers running any of a variety of commercially-available UNIX® orUNIX-like operating systems, including without limitation the variety ofGNU/Linux operating systems, such as for example, Google Chrome OS.Alternatively, or in addition, client computing devices 1302, 1304,1306, and 1308 may be any other electronic device, such as a thin-clientcomputer, an Internet-enabled gaming system (e.g., a Microsoft Xboxgaming console with or without a Kinect® gesture input device), and/or apersonal messaging device, capable of communicating over network(s)1310.

Although exemplary distributed system 1300 is shown with four clientcomputing devices, any number of client computing devices may besupported. Other devices, such as devices with sensors, etc., mayinteract with server 1312.

Network(s) 1310 in distributed system 1300 may be any type of networkthat can support data communications using any of a variety ofcommercially-available protocols, including without limitation TCP/IP(transmission control protocol/Internet protocol), SNA (systems networkarchitecture), IPX (Internet packet exchange), AppleTalk, and the like.Merely by way of example, network(s) 1310 can be a local area network(LAN), such as one based on Ethernet, Token-Ring and/or the like.Network(s) 1310 can be a wide-area network and the Internet. It caninclude a virtual network, including without limitation a virtualprivate network (VPN), an intranet, an extranet, a public switchedtelephone network (PSTN), an infra-red network, a wireless network(e.g., a network operating under any of the Institute of Electrical andElectronics (IEEE) 802.11 suite of protocols, Bluetooth®, and/or anyother wireless protocol); and/or any combination of these and/or othernetworks.

Server 1312 may be composed of one or more general purpose computers,specialized server computers (including, by way of example, PC (personalcomputer) servers, UNIX® servers, mid-range servers, mainframecomputers, rack-mounted servers, etc.), server farms, server clusters,or any other appropriate arrangement and/or combination. In variousembodiments, server 1312 may be adapted to run one or more services orsoftware applications described in the foregoing disclosure. Forexample, server 1312 may correspond to a server for performingprocessing described above according to an embodiment of the presentdisclosure.

Server 1312 may run an operating system including any of those discussedabove, as well as any commercially available server operating system.Server 1312 may also run any of a variety of additional serverapplications and/or mid-tier applications, including HTTP (hypertexttransport protocol) servers, FTP (file transfer protocol) servers, CGI(common gateway interface) servers, JAVA® servers, database servers, andthe like. Exemplary database servers include without limitation thosecommercially available from Oracle, Microsoft, Sybase, IBM(International Business Machines), and the like.

In some implementations, server 1312 may include one or moreapplications to analyze and consolidate data feeds and/or event updatesreceived from users of client computing devices 1302, 1304, 1306, and1308. As an example, data feeds and/or event updates may include, butare not limited to, Twitter® feeds, Facebook® updates or real-timeupdates received from one or more third party information sources andcontinuous data streams, which may include real-time events related tosensor data applications, financial tickers, network performancemeasuring tools (e.g., network monitoring and traffic managementapplications), clickstream analysis tools, automobile trafficmonitoring, and the like. Server 1312 may also include one or moreapplications to display the data feeds and/or real-time events via oneor more display devices of client computing devices 1302, 1304, 1306,and 1308.

Distributed system 1300 may also include one or more databases 1314 and1316. Databases 1314 and 1316 may reside in a variety of locations. Byway of example, one or more of databases 1314 and 1316 may reside on anon-transitory storage medium local to (and/or resident in) server 1312.Alternatively, databases 1314 and 1316 may be remote from server 1312and in communication with server 1312 via a network-based or dedicatedconnection. In one set of embodiments, databases 1314 and 1316 mayreside in a storage-area network (SAN). Similarly, any necessary filesfor performing the functions attributed to server 1312 may be storedlocally on server 1312 and/or remotely, as appropriate. In one set ofembodiments, databases 1314 and 1316 may include relational databases,such as databases provided by Oracle, that are adapted to store, update,and retrieve data in response to SQL-formatted commands.

FIG. 14 is a simplified block diagram of one or more components of asystem environment 1400 by which services provided by one or morecomponents of an embodiment system may be offered as cloud services, inaccordance with an embodiment of the present disclosure. In theillustrated embodiment, system environment 1400 includes one or moreclient computing devices 1404, 1406, and 1408 that may be used by usersto interact with a cloud infrastructure system 1402 that provides cloudservices. The client computing devices may be configured to operate aclient application such as a web browser, a proprietary clientapplication (e.g., Oracle Forms), or some other application, which maybe used by a user of the client computing device to interact with cloudinfrastructure system 1402 to use services provided by cloudinfrastructure system 1402.

It should be appreciated that cloud infrastructure system 1402 depictedin the figure may have other components than those depicted. Further,the embodiment shown in the figure is only one example of a cloudinfrastructure system that may incorporate some embodiments. In someother embodiments, cloud infrastructure system 1402 may have more orfewer components than shown in the figure, may combine two or morecomponents, or may have a different configuration or arrangement ofcomponents.

Client computing devices 1404, 1406, and 1408 may be devices similar tothose described above for 1302, 1304, 1306, and 1308.

Although exemplary system environment 1400 is shown with three clientcomputing devices, any number of client computing devices may besupported. Other devices such as devices with sensors, etc. may interactwith cloud infrastructure system 1402.

Network(s) 1410 may facilitate communications and exchange of databetween clients 1404, 1406, and 1408 and cloud infrastructure system1402. Each network may be any type of network that can support datacommunications using any of a variety of commercially-availableprotocols, including those described above for network(s) 1310.

Cloud infrastructure system 1402 may comprise one or more computersand/or servers that may include those described above for server 1312.

In certain embodiments, services provided by the cloud infrastructuresystem may include a host of services that are made available to usersof the cloud infrastructure system on demand, such as online datastorage and backup solutions, Web-based e-mail services, hosted officesuites and document collaboration services, database processing, managedtechnical support services, and the like. Services provided by the cloudinfrastructure system can dynamically scale to meet the needs of itsusers. A specific instantiation of a service provided by cloudinfrastructure system is referred to herein as a “service instance.” Ingeneral, any service made available to a user via a communicationnetwork, such as the Internet, from a cloud service provider's system isreferred to as a “cloud service.” Typically, in a public cloudenvironment, servers and systems that make up the cloud serviceprovider's system are different from the customer's own on-premisesservers and systems. For example, a cloud service provider's system mayhost an application, and a user may, via a communication network such asthe Internet, on demand, order and use the application.

In some examples, a service in a computer network cloud infrastructuremay include protected computer network access to storage, a hosteddatabase, a hosted web server, a software application, or other serviceprovided by a cloud vendor to a user, or as otherwise. For example, aservice can include password-protected access to remote storage on thecloud through the Internet. As another example, a service can include aweb service-based hosted relational database and a script-languagemiddleware engine for private use by a networked developer. As anotherexample, a service can include access to an email software applicationhosted on a cloud vendor's web site.

In certain embodiments, cloud infrastructure system 1402 may include asuite of applications, middleware, and database service offerings thatare delivered to a customer in a self-service, subscription-based,elastically scalable, reliable, highly available, and secure manner. Anexample of such a cloud infrastructure system is the Oracle Public Cloudprovided by the present assignee.

In various embodiments, cloud infrastructure system 1402 may be adaptedto automatically provision, manage and track a customer's subscriptionto services offered by cloud infrastructure system 1402. Cloudinfrastructure system 1402 may provide the cloud services via differentdeployment models. For example, services may be provided under a publiccloud model in which cloud infrastructure system 1402 is owned by anorganization selling cloud services (e.g., owned by Oracle) and theservices are made available to the general public or different industryenterprises. As another example, services may be provided under aprivate cloud model in which cloud infrastructure system 1402 isoperated solely for a single organization and may provide services forone or more entities within the organization. The cloud services mayalso be provided under a community cloud model in which cloudinfrastructure system 1402 and the services provided by cloudinfrastructure system 1402 are shared by several organizations in arelated community. The cloud services may also be provided under ahybrid cloud model, which is a combination of two or more differentmodels.

In some embodiments, the services provided by cloud infrastructuresystem 1402 may include one or more services provided under Software asa Service (SaaS) category, Platform as a Service (PaaS) category,Infrastructure as a Service (IaaS) category, or other categories ofservices including hybrid services. A customer, via a subscriptionorder, may order one or more services provided by cloud infrastructuresystem 1402. Cloud infrastructure system 1402 then performs processingto provide the services in the customer's subscription order.

In some embodiments, the services provided by cloud infrastructuresystem 1402 may include, without limitation, application services,platform services and infrastructure services. In some examples,application services may be provided by the cloud infrastructure systemvia a SaaS platform. The SaaS platform may be configured to providecloud services that fall under the SaaS category. For example, the SaaSplatform may provide capabilities to build and deliver a suite ofon-demand applications on an integrated development and deploymentplatform. The SaaS platform may manage and control the underlyingsoftware and infrastructure for providing the SaaS services. Byutilizing the services provided by the SaaS platform, customers canutilize applications executing on the cloud infrastructure system.Customers can acquire the application services without the need forcustomers to purchase separate licenses and support. Various differentSaaS services may be provided. Examples include, without limitation,services that provide solutions for sales performance management,enterprise integration, and business flexibility for largeorganizations.

In some embodiments, platform services may be provided by the cloudinfrastructure system via a PaaS platform. The PaaS platform may beconfigured to provide cloud services that fall under the PaaS category.Examples of platform services may include without limitation servicesthat enable organizations (such as Oracle) to consolidate existingapplications on a shared, common architecture, as well as the ability tobuild new applications that leverage the shared services provided by theplatform. The PaaS platform may manage and control the underlyingsoftware and infrastructure for providing the PaaS services. Customerscan acquire the PaaS services provided by the cloud infrastructuresystem without the need for customers to purchase separate licenses andsupport. Examples of platform services include, without limitation,Oracle JAVA Cloud Service (JCS), Oracle Database Cloud Service (DBCS),and others.

By utilizing the services provided by the PaaS platform, customers canemploy programming languages and tools supported by the cloudinfrastructure system and also control the deployed services. In someembodiments, platform services provided by the cloud infrastructuresystem may include database cloud services, middleware cloud services(e.g., Oracle Fusion Middleware services), and JAVA cloud services. Inone embodiment, database cloud services may support shared servicedeployment models that enable organizations to pool database resourcesand offer customers a Database as a Service in the form of a databasecloud. Middleware cloud services may provide a platform for customers todevelop and deploy various business applications, and JAVA cloudservices may provide a platform for customers to deploy JAVAapplications, in the cloud infrastructure system.

Various different infrastructure services may be provided by an IaaSplatform in the cloud infrastructure system. The infrastructure servicesfacilitate the management and control of the underlying computingresources, such as storage, networks, and other fundamental computingresources for customers utilizing services provided by the SaaS platformand the PaaS platform.

In certain embodiments, cloud infrastructure system 1402 may alsoinclude infrastructure resources 1430 for providing the resources usedto provide various services to customers of the cloud infrastructuresystem. In one embodiment, infrastructure resources 1430 may includepre-integrated and optimized combinations of hardware, such as servers,storage, and networking resources to execute the services provided bythe PaaS platform and the SaaS platform.

In some embodiments, resources in cloud infrastructure system 1402 maybe shared by multiple users and dynamically re-allocated per demand.Additionally, resources may be allocated to users in different timezones. For example, cloud infrastructure system 1430 may enable a firstset of users in a first time zone to utilize resources of the cloudinfrastructure system for a specified number of hours and then enablethe re-allocation of the same resources to another set of users locatedin a different time zone, thereby maximizing the utilization ofresources.

In certain embodiments, a number of internal shared services 1432 may beprovided that are shared by different components or modules of cloudinfrastructure system 1402 and by the services provided by cloudinfrastructure system 1402. These internal shared services may include,without limitation, a security and identity service, an integrationservice, an enterprise repository service, an enterprise managerservice, a virus scanning and white list service, a high availability,backup and recovery service, service for enabling cloud support, anemail service, a notification service, a file transfer service, and thelike.

In certain embodiments, cloud infrastructure system 1402 may providecomprehensive management of cloud services (e.g., SaaS, PaaS, and IaaSservices) in the cloud infrastructure system. In one embodiment, cloudmanagement functionality may include capabilities for provisioning,managing and tracking a customer's subscription received by cloudinfrastructure system 1402, and the like.

In one embodiment, as depicted in the figure, cloud managementfunctionality may be provided by one or more modules, such as an ordermanagement module 1420, an order orchestration module 1422, an orderprovisioning module 1424, an order management and monitoring module1426, and an identity management module 1428. These modules may includeor be provided using one or more computers and/or servers, which may begeneral purpose computers, specialized server computers, server farms,server clusters, or any other appropriate arrangement and/orcombination.

In exemplary operation 1434, a customer using a client device, such asclient device 1404, 1406 or 1408, may interact with cloud infrastructuresystem 1402 by requesting one or more services provided by cloudinfrastructure system 1402 and placing an order for a subscription forone or more services offered by cloud infrastructure system 1402. Incertain embodiments, the customer may access a cloud User Interface(UI), cloud UI 1412, cloud UI 1414 and/or cloud UI 1416 and place asubscription order via these UIs. The order information received bycloud infrastructure system 1402 in response to the customer placing anorder may include information identifying the customer and one or moreservices offered by the cloud infrastructure system 1402 that thecustomer intends to subscribe to.

After an order has been placed by the customer, the order information isreceived via the cloud UIs, 1412, 1414 and/or 1416.

At operation 1436, the order is stored in order database 1418. Orderdatabase 1418 can be one of several databases operated by cloudinfrastructure system 1418 and operated in conjunction with other systemelements.

At operation 1438, the order information is forwarded to an ordermanagement module 1420. In some instances, order management module 1420may be configured to perform billing and accounting functions related tothe order, such as verifying the order, and upon verification, bookingthe order.

At operation 1440, information regarding the order is communicated to anorder orchestration module 1422. Order orchestration module 1422 mayutilize the order information to orchestrate the provisioning ofservices and resources for the order placed by the customer. In someinstances, order orchestration module 1422 may orchestrate theprovisioning of resources to support the subscribed services using theservices of order provisioning module 1424.

In certain embodiments, order orchestration module 1422 enables themanagement of business processes associated with each order and appliesbusiness logic to determine whether an order should proceed toprovisioning. At operation 1442, upon receiving an order for a newsubscription, order orchestration module 1422 sends a request to orderprovisioning module 1424 to allocate resources and configure thoseresources needed to fulfill the subscription order. Order provisioningmodule 1424 enables the allocation of resources for the services orderedby the customer. Order provisioning module 1424 provides a level ofabstraction between the cloud services provided by cloud infrastructuresystem 1400 and the physical implementation layer that is used toprovision the resources for providing the requested services. Orderorchestration module 1422 may thus be isolated from implementationdetails, such as whether or not services and resources are actuallyprovisioned on the fly or pre-provisioned and only allocated/assignedupon request.

At operation 1444, once the services and resources are provisioned, anotification of the provided service may be sent to customers on clientdevices 1404, 1406 and/or 1408 by order provisioning module 1424 ofcloud infrastructure system 1402.

At operation 1446, the customer's subscription order may be managed andtracked by an order management and monitoring module 1426. In someinstances, order management and monitoring module 1426 may be configuredto collect usage statistics for the services in the subscription order,such as the amount of storage used, the amount data transferred, thenumber of users, and the amount of system up time and system down time.

In certain embodiments, cloud infrastructure system 1400 may include anidentity management module 1428. Identity management module 1428 may beconfigured to provide identity services, such as access management andauthorization services in cloud infrastructure system 1400. In someembodiments, identity management module 1428 may control informationabout customers who wish to utilize the services provided by cloudinfrastructure system 1402. Such information can include informationthat authenticates the identities of such customers and information thatdescribes which actions those customers are authorized to performrelative to various system resources (e.g., files, directories,applications, communication ports, memory segments, etc.) Identitymanagement module 1428 may also include the management of descriptiveinformation about each customer and about how and by whom thatdescriptive information can be accessed and modified.

FIG. 15 illustrates an exemplary computer system 1500, in which variousembodiments may be implemented. The system 1500 may be used to implementany of the computer systems described above. As shown in the figure,computer system 1500 includes a processing unit 1504 that communicateswith a number of peripheral subsystems via a bus subsystem 1502. Theseperipheral subsystems may include a processing acceleration unit 1506,an I/O subsystem 1508, a storage subsystem 1518 and a communicationssubsystem 1524. Storage subsystem 1518 includes tangiblecomputer-readable storage media 1522 and a system memory 1510.

Bus subsystem 1502 provides a mechanism for letting the variouscomponents and subsystems of computer system 1500 communicate with eachother as intended. Although bus subsystem 1502 is shown schematically asa single bus, alternative embodiments of the bus subsystem may utilizemultiple buses. Bus subsystem 1502 may be any of several types of busstructures including a memory bus or memory controller, a peripheralbus, and a local bus using any of a variety of bus architectures. Forexample, such architectures may include an Industry StandardArchitecture (ISA) bus, Micro Channel Architecture (MCA) bus, EnhancedISA (EISA) bus, Video Electronics Standards Association (VESA) localbus, and Peripheral Component Interconnect (PCI) bus, which can beimplemented as a Mezzanine bus manufactured to the IEEE P1386.1standard.

Processing unit 1504, which can be implemented as one or more integratedcircuits (e.g., a conventional microprocessor or microcontroller),controls the operation of computer system 1500. One or more processorsmay be included in processing unit 1504. These processors may includesingle core or multicore processors. In certain embodiments, processingunit 1504 may be implemented as one or more independent processing units1532 and/or 1534 with single or multicore processors included in eachprocessing unit. In other embodiments, processing unit 1504 may also beimplemented as a quad-core processing unit formed by integrating twodual-core processors into a single chip.

In various embodiments, processing unit 1504 can execute a variety ofprograms in response to program code and can maintain multipleconcurrently executing programs or processes. At any given time, some orall of the program code to be executed can be resident in processor(s)1504 and/or in storage subsystem 1518. Through suitable programming,processor(s) 1504 can provide various functionalities described above.Computer system 1500 may additionally include a processing accelerationunit 1506, which can include a digital signal processor (DSP), aspecial-purpose processor, and/or the like.

I/O subsystem 1508 may include user interface input devices and userinterface output devices. User interface input devices may include akeyboard, pointing devices such as a mouse or trackball, a touchpad ortouch screen incorporated into a display, a scroll wheel, a click wheel,a dial, a button, a switch, a keypad, audio input devices with voicecommand recognition systems, microphones, and other types of inputdevices. User interface input devices may include, for example, motionsensing and/or gesture recognition devices such as the Microsoft Kinect®motion sensor that enables users to control and interact with an inputdevice, such as the Microsoft Xbox® 360 game controller, through anatural user interface using gestures and spoken commands. Userinterface input devices may also include eye gesture recognition devicessuch as the Google Glass® blink detector that detects eye activity(e.g., ‘blinking’ while taking pictures and/or making a menu selection)from users and transforms the eye gestures as input into an input device(e.g., Google Glass®). Additionally, user interface input devices mayinclude voice recognition sensing devices that enable users to interactwith voice recognition systems (e.g., Siri® navigator), through voicecommands.

User interface input devices may also include, without limitation, threedimensional (3D) mice, joysticks or pointing sticks, gamepads andgraphic tablets, and audio/visual devices such as speakers, digitalcameras, digital camcorders, portable media players, webcams, imagescanners, fingerprint scanners, barcode reader 3D scanners, 3D printers,laser rangefinders, and eye gaze tracking devices. Additionally, userinterface input devices may include, for example, medical imaging inputdevices such as computed tomography, magnetic resonance imaging,position emission tomography, medical ultrasonography devices. Userinterface input devices may also include, for example, audio inputdevices such as MIDI keyboards, digital musical instruments and thelike.

User interface output devices may include a display subsystem, indicatorlights, or non-visual displays such as audio output devices, etc. Thedisplay subsystem may be a cathode ray tube (CRT), a flat-panel device,such as that using a liquid crystal display (LCD) or plasma display, aprojection device, a touch screen, and the like. In general, use of theterm “output device” is intended to include all possible types ofdevices and mechanisms for outputting information from computer system1500 to a user or other computer. For example, user interface outputdevices may include, without limitation, a variety of display devicesthat visually convey text, graphics and audio/video information such asmonitors, printers, speakers, headphones, automotive navigation systems,plotters, voice output devices, and modems.

Computer system 1500 may comprise a storage subsystem 1518 thatcomprises software elements, shown as being currently located within asystem memory 1510. System memory 1510 may store program instructionsthat are loadable and executable on processing unit 1504, as well asdata generated during the execution of these programs.

Depending on the configuration and type of computer system 1500, systemmemory 1510 may be volatile (such as random access memory (RAM)) and/ornon-volatile (such as read-only memory (ROM), flash memory, etc.) TheRAM typically contains data and/or program modules that are immediatelyaccessible to and/or presently being operated and executed by processingunit 1504. In some implementations, system memory 1510 may includemultiple different types of memory, such as static random access memory(SRAM) or dynamic random access memory (DRAM). In some implementations,a basic input/output system (BIOS), containing the basic routines thathelp to transfer information between elements within computer system1500, such as during start-up, may typically be stored in the ROM. Byway of example, and not limitation, system memory 1510 also illustratesapplication programs 1512, which may include client applications, Webbrowsers, mid-tier applications, relational database management systems(RDBMS), etc., program data 1514, and an operating system 1516. By wayof example, operating system 1516 may include various versions ofMicrosoft Windows®, Apple Macintosh®, and/or Linux operating systems, avariety of commercially-available UNIX® or UNIX-like operating systems(including without limitation the variety of GNU/Linux operatingsystems, the Google Chrome® OS, and the like) and/or mobile operatingsystems such as iOS, Windows® Phone, Android® OS, BlackBerry® 10 OS, andPalm® OS operating systems.

Storage subsystem 1518 may also provide a tangible computer-readablestorage medium for storing the basic programming and data constructsthat provide the functionality of some embodiments. Software (programs,code modules, instructions) that when executed by a processor providethe functionality described above may be stored in storage subsystem1518. These software modules or instructions may be executed byprocessing unit 1504. Storage subsystem 1518 may also provide arepository for storing data used in accordance with some embodiments.

Storage subsystem 1500 may also include a computer-readable storagemedia reader 1520 that can further be connected to computer-readablestorage media 1522. Together and, optionally, in combination with systemmemory 1510, computer-readable storage media 1522 may comprehensivelyrepresent remote, local, fixed, and/or removable storage devices plusstorage media for temporarily and/or more permanently containing,storing, transmitting, and retrieving computer-readable information.

Computer-readable storage media 1522 containing code, or portions ofcode, can also include any appropriate media, including storage mediaand communication media, such as but not limited to, volatile andnon-volatile, removable and non-removable media implemented in anymethod or technology for storage and/or transmission of information.This can include tangible computer-readable storage media such as RAM,ROM, electronically erasable programmable ROM (EEPROM), flash memory orother memory technology, CD-ROM, digital versatile disk (DVD), or otheroptical storage, magnetic cassettes, magnetic tape, magnetic diskstorage or other magnetic storage devices, or other tangible computerreadable media. This can also include nontangible computer-readablemedia, such as data signals, data transmissions, or any other mediumwhich can be used to transmit the desired information and which can beaccessed by computing system 1500.

By way of example, computer-readable storage media 1522 may include ahard disk drive that reads from or writes to non-removable, nonvolatilemagnetic media, a magnetic disk drive that reads from or writes to aremovable, nonvolatile magnetic disk, and an optical disk drive thatreads from or writes to a removable, nonvolatile optical disk such as aCD ROM, DVD, and Blu-Ray® disk, or other optical media.Computer-readable storage media 1522 may include, but is not limited to,Zip® drives, flash memory cards, universal serial bus (USB) flashdrives, secure digital (SD) cards, DVD disks, digital video tape, andthe like. Computer-readable storage media 1522 may also include,solid-state drives (SSD) based on non-volatile memory such asflash-memory based SSDs, enterprise flash drives, solid state ROM, andthe like, SSDs based on volatile memory such as solid state RAM, dynamicRAM, static RAM, DRAM-based SSDs, magnetoresistive RAM (MRAM) SSDs, andhybrid SSDs that use a combination of DRAM and flash memory based SSDs.The disk drives and their associated computer-readable media may providenon-volatile storage of computer-readable instructions, data structures,program modules, and other data for computer system 1500.

Communications subsystem 1524 provides an interface to other computersystems and networks. Communications subsystem 1524 serves as aninterface for receiving data from and transmitting data to other systemsfrom computer system 1500. For example, communications subsystem 1524may enable computer system 1500 to connect to one or more devices viathe Internet. In some embodiments communications subsystem 1524 caninclude radio frequency (RF) transceiver components for accessingwireless voice and/or data networks (e.g., using cellular telephonetechnology, advanced data network technology, such as 3G, 4G or EDGE(enhanced data rates for global evolution), WiFi (IEEE 802.11 familystandards, or other mobile communication technologies, or anycombination thereof), global positioning system (GPS) receivercomponents, and/or other components. In some embodiments communicationssubsystem 1524 can provide wired network connectivity (e.g., Ethernet)in addition to or instead of a wireless interface.

In some embodiments, communications subsystem 1524 may also receiveinput communication in the form of structured and/or unstructured datafeeds 1526, event streams 1528, event updates 1530, and the like onbehalf of one or more users who may use computer system 1500.

By way of example, communications subsystem 1524 may be configured toreceive data feeds 1526 in real-time from users of social networksand/or other communication services such as Twitter® feeds, Facebook®updates, web feeds such as Rich Site Summary (RSS) feeds, and/orreal-time updates from one or more third party information sources.

Additionally, communications subsystem 1524 may also be configured toreceive data in the form of continuous data streams, which may includeevent streams 1528 of real-time events and/or event updates 1530, thatmay be continuous or unbounded in nature with no explicit end. Examplesof applications that generate continuous data may include, for example,sensor data applications, financial tickers, network performancemeasuring tools (e.g. network monitoring and traffic managementapplications), clickstream analysis tools, automobile trafficmonitoring, and the like.

Communications subsystem 1524 may also be configured to output thestructured and/or unstructured data feeds 1526, event streams 1528,event updates 1530, and the like to one or more databases that may be incommunication with one or more streaming data source computers coupledto computer system 1500.

Computer system 1500 can be one of various types, including a handheldportable device (e.g., an iPhone® cellular phone, an iPad® computingtablet, a PDA), a wearable device (e.g., a Google Glass® head mounteddisplay), a PC, a workstation, a mainframe, a kiosk, a server rack, orany other data processing system.

Due to the ever-changing nature of computers and networks, thedescription of computer system 1500 depicted in the figure is intendedonly as a specific example. Many other configurations having more orfewer components than the system depicted in the figure are possible.For example, customized hardware might also be used and/or particularelements might be implemented in hardware, firmware, software (includingapplets), or a combination. Further, connection to other computingdevices, such as network input/output devices, may be employed. Based onthe disclosure and teachings provided herein, other ways and/or methodsmay be used to implement the various embodiments.

In the foregoing description, for the purposes of explanation, numerousspecific details were set forth in order to provide a thoroughunderstanding of various embodiments. It will be apparent, however, thatthese embodiments may be practiced without some of these specificdetails. In other instances, well-known structures and devices are shownin block diagram form.

The foregoing description provides exemplary embodiments only, and isnot intended to limit the scope, applicability, or configuration of thedisclosure. Rather, the foregoing description of the exemplaryembodiments provide an enabling description for implementing at leastone embodiment. It should be understood that various changes may be madein the function and arrangement of elements without departing from thespirit and scope of some embodiments as set forth in the appendedclaims.

Specific details are given in the foregoing description to provide athorough understanding of the embodiments. However, the embodiments maybe practiced without these specific details. For example, circuits,systems, networks, processes, and other components may have been shownas components in block diagram form in order not to obscure theembodiments in unnecessary detail. In other instances, well-knowncircuits, processes, algorithms, structures, and techniques may havebeen shown without unnecessary detail in order to avoid obscuring theembodiments.

Also, it is noted that individual embodiments may have been described asa process which is depicted as a flowchart, a flow diagram, a data flowdiagram, a structure diagram, or a block diagram. Although a flowchartmay have described the operations as a sequential process, many of theoperations can be performed in parallel or concurrently. In addition,the order of the operations may be re-arranged. A process is terminatedwhen its operations are completed, but could have additional steps notincluded in a figure. A process may correspond to a method, a function,a procedure, a subroutine, a subprogram, etc. When a process correspondsto a function, its termination can correspond to a return of thefunction to the calling function or the main function.

The term “computer-readable medium” includes, but is not limited toportable or fixed storage devices, optical storage devices, wirelesschannels and various other mediums capable of storing, containing, orcarrying instruction(s) and/or data. A code segment ormachine-executable instructions may represent a procedure, a function, asubprogram, a program, a routine, a subroutine, a module, a softwarepackage, a class, or any combination of instructions, data structures,or program statements. A code segment may be coupled to another codesegment or a hardware circuit by passing and/or receiving information,data, arguments, parameters, or memory contents. Information, arguments,parameters, data, etc., may be passed, forwarded, or transmitted via anysuitable means including memory sharing, message passing, token passing,network transmission, etc.

Furthermore, embodiments may be implemented by hardware, software,firmware, middleware, microcode, hardware description languages, or anycombination thereof. When implemented in software, firmware, middlewareor microcode, the program code or code segments to perform the necessarytasks may be stored in a machine readable medium. A processor(s) mayperform the necessary tasks.

In the foregoing specification, aspects of various embodiments aredescribed with reference to specific embodiments thereof, but not allembodiments are limited thereto. Various features and aspects of theabove-described embodiments may be used individually or jointly.Further, embodiments can be utilized in any number of environments andapplications beyond those described herein without departing from thebroader spirit and scope of the specification. The specification anddrawings are, accordingly, to be regarded as illustrative rather thanrestrictive.

Additionally, for the purposes of illustration, methods were describedin a particular order. It should be appreciated that in alternateembodiments, the methods may be performed in a different order than thatdescribed. It should also be appreciated that the methods describedabove may be performed by hardware components or may be embodied insequences of machine-executable instructions, which may be used to causea machine, such as a general-purpose or special-purpose processor orlogic circuits programmed with the instructions to perform the methods.These machine-executable instructions may be stored on one or moremachine readable mediums, such as CD-ROMs or other type of opticaldisks, floppy diskettes, ROMs, RAMs, EPROMs, EEPROMs, magnetic oroptical cards, flash memory, or other types of machine-readable mediumssuitable for storing electronic instructions. Alternatively, the methodsmay be performed by a combination of hardware and software.

What is claimed is:
 1. A non-transitory computer-readable mediumcomprising instructions that, when executed by one or more processors,cause the one or more processors to perform operations comprising:creating, at the programming language framework, an instance of adynamic validation class comprising a plurality of validators as anentry point for dynamic validation; receiving, at the programminglanguage framework, an instance of an object at runtime, wherein adefinition of the object is annotated with a constraint; receiving, atthe programming language framework, one or more validators from theplurality of validators that are annotated with an annotation thatidentifies: an attribute in the definition of the object; and a valuefor an attribute in the definition of the object; and identifying, atthe programming language framework, a validator in the one or morevalidators for which a value of the attribute in the instance of theobject at runtime matches the value for the attribute in the annotationof the validator, wherein changing the value of the attribute at runtimechanges the validator selected at runtime from the one or morevalidators.
 2. The non-transitory computer-readable medium of claim 1,wherein the validator validates a value of an additional attribute inthe definition of the object.
 3. The non-transitory computer-readablemedium of claim 1, wherein the one or more validators comprises a secondvalidator for which the value of the attribute in the instance of theobject does not match the value for the attribute in the annotation ofthe second validator.
 4. The non-transitory computer-readable medium ofclaim 1, wherein the constraint with which the definition of the objectis annotated causes the programming language framework to use dynamicvalidation rather than static validation.
 5. The non-transitorycomputer-readable medium of claim 4, wherein the programming languageframework comprises a definition for the constraint with which thedefinition of the object is annotated, wherein the definition for theconstraint specifies that the constraint is compatible with object typetargets.
 6. The non-transitory computer-readable medium of claim 1,wherein the programming language framework comprises a definition forthe annotation with which the one or more validators are annotated,wherein the definition comprises an attribute name and an attributevalue pattern.
 7. The non-transitory computer-readable medium of claim1, wherein the programming language framework comprises a definition ofan abstract class from which each of the one or more validators isinherited.
 8. The non-transitory computer-readable medium of claim 7,wherein the abstract class comprises an abstract function thatdetermines if a constraint is valid for an object.
 9. The non-transitorycomputer-readable medium of claim 7, wherein the abstract classcomprises a protected function that validates an object against customconstraints.
 10. The non-transitory computer-readable medium of claim 1,wherein the programming language framework comprises a definition of aclass that scans a class path and identifies each of the one or morevalidators in the class path.
 11. The non-transitory computer-readablemedium of claim 10, wherein the definition of the class includes afunction that filters out ones of the one or more validators for whichthe value of the attribute in the instance of the object does not matchthe values for the attributes in the annotations of the ones of the oneor more validators.
 12. The non-transitory computer-readable medium ofclaim 10, wherein the definition of the class first executes any staticvalidations before executing any dynamic validations.
 13. Thenon-transitory computer-readable medium of claim 1, wherein the instanceof the object comprises the attribute and an additional attribute. 14.The non-transitory computer-readable medium of claim 13, wherein theattribute determines which of the one or more validators should be usedto validate a value assigned to the additional attribute.
 15. Thenon-transitory computer-readable medium of claim 14, wherein theattribute comprises a key and the second additional attribute comprisesa value in a key-value pair.
 16. The non-transitory computer-readablemedium of claim 15, wherein the key indicates a datatype of the value.17. The non-transitory computer-readable medium of claim 1, wherein: thevalidator is annotated with an additional annotation that identifies anadditional attribute in the definition of the object and an additionalvalue for the additional attribute; and a value of an additionalattribute in the instance of the object matches the additional value forthe additional attribute in the additional annotation of the validator.18. A system comprising: one or more processors; and one or more memorydevices comprising instructions that, when executed by the one or moreprocessors, cause the one or more processors to perform operationscomprising: creating, at the programming language framework, an instanceof a dynamic validation class comprising a plurality of validators as anentry point for dynamic validation; receiving, at the programminglanguage framework, an instance of an object at runtime, wherein adefinition of the object is annotated with a constraint; receiving, atthe programming language framework, one or more validators from theplurality of validators that are annotated with an annotation thatidentifies: an attribute in the definition of the object; and a valuefor an attribute in the definition of the object; and identifying, atthe programming language framework, a validator in the one or morevalidators for which a value of the attribute in the instance of theobject at runtime matches the value for the attribute in the annotationof the validator, wherein changing the value of the attribute at runtimechanges the validator selected at runtime from the one or morevalidators.
 19. A method of executing dynamic validation in programminglanguage frameworks, the method comprising: creating, at the programminglanguage framework, an instance of a dynamic validation class comprisinga plurality of validators as an entry point for dynamic validation;receiving, at the programming language framework, an instance of anobject at runtime, wherein a definition of the object is annotated witha constraint; receiving, at the programming language framework, one ormore validators from the plurality of validators that are annotated withan annotation that identifies: an attribute in the definition of theobject; and a value for an attribute in the definition of the object;and identifying, at the programming language framework, a validator inthe one or more validators for which a value of the attribute in theinstance of the object at runtime matches the value for the attribute inthe annotation of the validator, wherein changing the value of theattribute at runtime changes the validator selected at runtime from theone or more validators.